package com.party.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.party.business.domain.Kc;
import com.party.business.mapper.KcMapper;
import com.party.business.service.IKcService;
import com.party.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 课程信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-03
 */
@Service
public class KcServiceImpl extends ServiceImpl<KcMapper, Kc>  implements IKcService
{
    @Autowired
    private KcMapper kcMapper;

    /**
     * 查询课程信息
     *
     * @param id 课程信息主键
     * @return 课程信息
     */
    @Override
    public Kc selectKcById(String id)
    {
        return kcMapper.selectKcById(id);
    }
    @Override
    public Kc selectKcByIdApp(Kc kc)
    {
        return kcMapper.selectKcByIdApp(kc);
    }



    /**
     * 查询课程信息列表
     *
     * @param kc 课程信息
     * @return 课程信息
     */
    @Override
    public List<Kc> selectKcList(Kc kc)
    {
        return kcMapper.selectKcList(kc);
    }

    @Override
    public List<Kc> selectKcListApp(Kc kc)
    {
        return kcMapper.selectKcListApp(kc);
    }

    @Override
    public List<Kc> selectKcListScApp(Kc kc)
    {
        return kcMapper.selectKcListScApp(kc);
    }


    /**
     * 新增课程信息
     *
     * @param kc 课程信息
     * @return 结果
     */
    @Override
    public int insertKc(Kc kc)
    {
                kc.setCreateTime(DateUtils.getNowDate());
            return kcMapper.insertKc(kc);
    }

    /**
     * 修改课程信息
     *
     * @param kc 课程信息
     * @return 结果
     */
    @Override
    public int updateKc(Kc kc)
    {
                kc.setUpdateTime(DateUtils.getNowDate());
        return kcMapper.updateKc(kc);
    }

    /**
     * 批量删除课程信息
     *
     * @param ids 需要删除的课程信息主键
     * @return 结果
     */
    @Override
    public int deleteKcByIds(String[] ids)
    {
        return kcMapper.deleteKcByIds(ids);
    }

    /**
     * 删除课程信息信息
     *
     * @param id 课程信息主键
     * @return 结果
     */
    @Override
    public int deleteKcById(String id)
    {
        return kcMapper.deleteKcById(id);
    }
}
